/*
 * fdm1d.c
 *
 *  Created on: Apr 11, 2010
 *      Author: nish
 */
#include "fdm1dutils.h"


main(){
	gsl_matrix* H;
	/*
	 * Eigen vector/Value declaration
	 */
	gsl_vector* eig_val;
	gsl_matrix* eig_vect;


	// init all constants
	initConstants();
	printConstants();

	printf("Forming the HMatrix\n");
	//form Hmatrix
	H = formHMatrix();

	//printHMatrix
	//printHMatrix(H);

	//saveHMatrix
	printf("Saving the HMatrix\n");
	saveMatrix(H,"HMatrix1.dat");

	eig_val = gsl_vector_alloc(npoints);
	eig_vect = gsl_matrix_alloc(npoints,npoints);

	//get eigen values and eigen vectors of Hmatrix
	printf("Solving for eigen values\n");
	solveEig(H,eig_val,eig_vect);
	printf("MAIN SIZE EVAL >> %d\n",eig_val->size);

	//print eigen values
	//printEig(eig_val,eig_vect);
	makePlotFiles(eig_val,eig_vect);

	//plot eigen vector, square of eigen vectors
	printf("Exiting the 11 main\n");
}
